From 6b7047253ac300a0eb57c3034a4d1d5a9433f2eb Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Sat, 19 Nov 2005 15:41:08 -0600 Subject: [PATCH] Recode usage of FPSR_DEFAULT due to strange double declaration --- tools/libxc/xc_ia64_stubs.c | 15 +++++++++++++++ tools/libxc/xc_linux_build.c | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_ia64_stubs.c b/tools/libxc/xc_ia64_stubs.c index e926c87c33..4b11af60e4 100644 --- a/tools/libxc/xc_ia64_stubs.c +++ b/tools/libxc/xc_ia64_stubs.c @@ -7,6 +7,21 @@ #include "xen/arch-ia64.h" #include +/* this is a very ugly way of getting FPSR_DEFAULT. struct ia64_fpreg is + * mysteriously declared in two places: /usr/include/asm/fpu.h and + * /usr/include/bits/sigcontext.h. The former also defines FPSR_DEFAULT, + * the latter doesn't but is included (indirectly) by xg_private.h */ +#define __ASSEMBLY__ +#include +#undef __IA64_UL +#define __IA64_UL(x) ((unsigned long)(x)) +#undef __ASSEMBLY__ + +unsigned long xc_ia64_fpsr_default(void) +{ + return FPSR_DEFAULT; +} + int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, uint32_t max_factor, uint32_t flags) { diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 4cc145c931..cb72db04d6 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -278,7 +278,8 @@ static int setup_pg_tables_64(int xc_handle, uint32_t dom, #endif #ifdef __ia64__ -#include /* for FPSR_DEFAULT */ +extern unsigned long xc_ia64_fpsr_default(void); + static int setup_guest(int xc_handle, uint32_t dom, char *image, unsigned long image_size, @@ -780,7 +781,7 @@ int xc_linux_build(int xc_handle, ctxt->regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */ ctxt->regs.cr_iip = vkern_entry; ctxt->regs.cr_ifs = 1UL << 63; - ctxt->regs.ar_fpsr = FPSR_DEFAULT; + ctxt->regs.ar_fpsr = xc_ia64_fpsr_default(); /* currently done by hypervisor, should move here */ /* ctxt->regs.r28 = dom_fw_setup(); */ ctxt->vcpu.privregs = 0; -- 2.30.2